<template>
    <div class="opneCard"> 
        <transition enter-active-class="animated bounceIn" leave-active-class="animated fadeOut">
            <div class="opneCard" v-show="cards.show">
                    <!-- 文字 -->
                    <div class="CardTop">
                        <p>闲{{cards.card.left.cardResult}}</p>
                        <p class="pCneter">{{cards.Result}}</p>
                        <p class="pRight">{{cards.card.right.cardResult}}</p>
                    </div>
                    <!-- 牌 -->
                    <div class="CardCenter">
                        <!-- 左边牌 -->
                        <div class="left">
                            <div class="CardBox" v-for="cardd in cards.card.right.cardCenter" :class="'card'+cardd"></div>
                        </div>
                        <!-- 右边牌 -->
                        <div class="right">
                            <div class="CardBox" v-for="cardd in cards.card.right.cardCenter" :class="'card'+cardd"></div>
                        </div>
                    </div>
            </div>		
        </transition>
    </div>         
</template>
<script>
export default {
    name:"opneCard",
    data(){
        return {
             init: {
        personal: {
          name: "DDD1号",
          money: 12000
        },
        Room: {
          nember: "百家乐A1",
          gameNum: "GCS15200",
          gameRedTop: "20-6000",
          personalRedTop: "500",
          personalDownMoney: 0,
          onLine: 988,
          z: 0,
          h: 0,
          he: 0,
          z2: 0,
          h2: 0,
          videoBox: {
            one: true,
            two: true
          },
          Player: {},
          sonRooom: {
            迪威一厅: [
              {
                id: 1,
                time: 30
              },
              {
                id: 2,
                time: 45
              },
              {
                id: 3,
                time: 25
              },
              {
                id: 4,
                time: 18
              },
              {
                id: 5,
                time: 50
              },
              {
                id: 6,
                time: 30
              },
              {
                id: 7,
                time: 30
              },
              {
                id: 8,
                time: 30
              },
              {
                id: 9,
                time: 12
              },
              {
                id: 10,
                time: 50
              },
              {
                id: 11,
                time: 55
              },
              {
                id: 12,
                time: 60
              },
              {
                id: 13,
                time: 9
              },
              {
                id: 14,
                time: 12
              },
              {
                id: 15,
                time: 17
              },
              {
                id: 16,
                time: 60
              },
              {
                id: 17,
                time: 5
              },
              {
                id: 18,
                time: 19
              },
              {
                id: 19,
                time: 48
              },
              {
                id: 20,
                time: 30
              },
              {
                id: 21,
                time: 30
              },
              {
                id: 22,
                time: 60
              },
              {
                id: 23,
                time: 52
              },
              {
                id: 24,
                time: 48
              },
              {
                id: 25,
                time: 37
              },
              {
                id: 26,
                time: 34
              },
              {
                id: 27,
                time: 46
              },
              {
                id: 28,
                time: 50
              },
              {
                id: 29,
                time: 52
              },
              {
                id: 30,
                time: 51
              }
            ],
            迪威二厅: [
              {
                id: 1,
                time: 30
              },
              {
                id: 2,
                time: 45
              },
              {
                id: 3,
                time: 25
              },
              {
                id: 4,
                time: 18
              },
              {
                id: 5,
                time: 50
              },
              {
                id: 6,
                time: 30
              },
              {
                id: 7,
                time: 30
              },
              {
                id: 8,
                time: 30
              },
              {
                id: 9,
                time: 12
              }
            ]
          }
        }
      },
             // 开牌结果
            cards: {
                show: false,
                card: {
                    left: { cardCenter: ['1', 'k',], cardResult: 1 },
                    right: { cardCenter: ['3', 'j'], cardResult: 3 }
                },
                Result: "庄赢"
            },
            cardResult: "",
            }
    },
    mounted(){
        var _this = this;
        setInterval(function () {
            var i;
            _this.time--;
            if (_this.time < 0) {
                _this.cards.show = true;
                _this.cardResult = "isBanker 0.5s infinite linear  ";
                _this.time = 60;
            }
            else if (_this.time < 54) {
                _this.cards.show = false;
                _this.cardResult = "";
            }
            _this.star = true;
            for (i in _this.init.Room.sonRooom) {
                _this.init.Room.sonRooom[i].forEach(function (state) {
                    if (state.time == 0) {
                        state.time = 60;
                    }
                    else {
                        state.time--;
                    }
                });
            }
        }, 1000);
    },
    
}
</script>

